function publishfolder(Folder,X,OnlyFiles)

thisDir = fullfile(irisroot(),'^help',Folder);
fprintf('%s in %s\n',Folder,thisDir);

if isempty(OnlyFiles)
    utils.delete(fullfile(thisDir,'*.tex'));
    utils.delete(fullfile(thisDir,'*.html'));
end

% Sort by .
ls = { X.Contents(:).SYNTAX };
[~, posSorted] = sort(lower(ls));

for i = posSorted(:).'
    thisFunc = X.Contents(i);
    ref = thisFunc.REF;
    if isempty(OnlyFiles) || any(strcmpi(ref,OnlyFiles))        
        irisroom.pandoc('file', thisFunc);
        fprintf('\t%s\n',ref);
    end
end

irisroom.pandoc('folder', X);

end
